package flc.ast.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.stark.more.about.DefAboutActivity;

import flc.ast.R;
import flc.ast.activity.SettingActivity;
import flc.ast.databinding.FragmentMyBinding;
import stark.common.basic.base.BaseActivity;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.base.BaseWebviewActivity;
import stark.common.basic.event.EventStatProxy;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link MyFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class MyFragment extends BaseNoModelFragment<FragmentMyBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_my;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(getActivity(), mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(getActivity(), mDataBinding.event5Container);
        mDataBinding.llSetting.setOnClickListener(this);
        mDataBinding.llAbout.setOnClickListener(this);
        mDataBinding.llFeedback.setOnClickListener(this);
        mDataBinding.llPrivacy.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()){
            case R.id.llSetting:
                startActivity(SettingActivity.class);
                break;
            case R.id.llPrivacy:
                BaseWebviewActivity.openAssetPrivacy(mContext);
                break;
            case R.id.llFeedback:
                BaseWebviewActivity.openFeedback(mContext);
                break;
            case R.id.llAbout:
                startActivity(DefAboutActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}